﻿var serveAppBk5Html = [];
var UlAppUlHtml = [];
$(document).ready(function (e) {
	
	$("body").addClass("danyebody");
	
	
    for (var i = 0; i < $(".serveAppBk5").length; i++) {
        var newArry = [];
        $(".serveAppBk5").eq(i).find("li").each(function (index, element) {
            newArry.push($(this).html());
        });
        serveAppBk5Html.push(newArry);
        UlAppUlHtml.push($(".serveAppBk5").eq(i).html());
    }

    quehuanIntUl(0);
    $(".DtiasNv a").click(function () {
        var intsx = $(".DtiasNv a").index(this);
        quehuanIntUl(intsx);
    })


    function quehuanIntUl(ins) {
        $(".serveAppBk5").html("").hide();
        $(".serveAppBk5").eq(ins).html(UlAppUlHtml[ins]).show();
        serveAppBk5Angus($(".serveAppBk5").eq(ins), ins);
        $(".DtiasNv a").removeClass("curensQhs").eq(ins).addClass("curensQhs");
    }

});
function serveAppBk5Angus(obj, curInary) {
    var curenTiNT = 0;
    var curAry = curInary;
  //  resizeBank4();
    $(window).resize(function () {
        //resizeBank4();
    })

    $(obj).find(".AppBk5dianNUm span").removeClass("curnsdscss").eq(curenTiNT).addClass("curnsdscss");
    $(".serveAppBk5 li").html("");
    $(".serveAppBk5").eq(curAry).find("li").eq(0).html(serveAppBk5Html[curAry][0]);
    /*$(".serveAppBk5_ul li a").hover(function () {
        $(this).find(".img").stop().animate({ width: "110%", height: "110%" }, 700, "linear")
    }, function () {
        $(this).find(".img").stop().animate({ width: "100%", height: "100%" }, 200, "linear")

    })*/
    /*$(obj).find(".serveAppBk5_ul li a").hover(function () {
        $(this).find("span").stop().animate({ bottom: 0 }, 300, "easeInOutCubic");
    }, function () {
        $(this).find("span").stop().animate({ bottom: -30 }, 300, "easeInOutCubic");
    })

    $(obj).find(".AppBk5dianNUm span").click(function () {
        var curssax = $(obj).find(".AppBk5dianNUm span").index(this);
        animatdds(curssax);
    })*/

    /////////////手势滑动///////////
  /*  var setInjisdsa;
    var bolltsAsTime = true;
    $(obj).find(".serveAppBk5_ul").bind("swipeleft swipeleftdown swipeleftup", function () {
        if (bolltsAsTime) {
            var curssax = curenTiNT + 1;
            animatdds(curssax);
            bolltsAsTime = false;
            clearTimeout(setInjisdsa);
            setInjisdsa = setTimeout(bolltsAsTimehs, 300);
        }

    });
    $(obj).find(".serveAppBk5_ul").bind("swiperight swiperightup swiperightdown", function () {
        if (bolltsAsTime) {
            var curssax = curenTiNT - 1;
            animatdds(curssax);
            bolltsAsTime = false;
            clearTimeout(setInjisdsa);
            setInjisdsa = setTimeout(bolltsAsTimehs, 300);
        }
    });
    function bolltsAsTimehs() {
        bolltsAsTime = true;

    }

    function animatdds(curssax) {
        $(".serveAppBk5").eq(curAry).find("li").eq(curssax).html(serveAppBk5Html[curAry][curssax]);
        $(".serveAppBk5_ul li a").hover(function () {
            $(this).find(".img").stop().animate({ width: "110%", height: "110%" }, 700, "linear")
        }, function () {
            $(this).find(".img").stop().animate({ width: "100%", height: "100%" }, 200, "linear")

        })
        $(obj).find(".serveAppBk5_ul li a").hover(function () {
            $(this).find("span").stop().animate({ bottom: 0 }, 300, "easeInOutCubic");
        }, function () {
            $(this).find("span").stop().animate({ bottom: -30 }, 300, "easeInOutCubic");
        })
        if (curssax > curenTiNT) {
            $(obj).find(".serveAppBk5_ul li").eq(curssax).stop().css({ left: $(window).width() }).animate({ left: 0 }, 500, "easeInOutCubic");
            $(obj).find(".serveAppBk5_ul li").eq(curenTiNT).stop().css({ left: 0 }).animate({ left: -$(window).width() }, 500, "easeInOutCubic");
            curenTiNT = curssax;
        }

        if (curssax < curenTiNT) {
            $(obj).find(".serveAppBk5_ul li").eq(curssax).stop().css({ left: -$(window).width() }).animate({ left: 0 }, 500, "easeInOutCubic");
            $(obj).find(".serveAppBk5_ul li").eq(curenTiNT).stop().css({ left: 0 }).animate({ left: $(window).width() }, 500, "easeInOutCubic");
            curenTiNT = curssax;
        }
        $(obj).find(".AppBk5dianNUm span").removeClass("curnsdscss").eq(curenTiNT).addClass("curnsdscss");

    }*/

    function resizeBank4() {
        $(obj).find(".serveAppBk5_ul").height($(obj).find(".serveAppBk5_ul li").eq(0).height());
        $(obj).find(".serveAppBk5_ul li").each(function (index, element) {
            if (index != curenTiNT) {
                $(this).css("left", $(window).width());
            } else {
                $(this).css("left", 0);
            }
        });

    }

}
